|
The Möller–Trumbore ray-triangle intersection algorithm, named after its inventors Tomas Möller and Ben Trumbore, is a fast method for calculating the intersection of a ray and a triangle in three dimensions without needing precomputation of the plane equation of the plane containing the triangle.〔(Fast, Minimum Storage Ray/Triangle Intersection ), Möller & Trumbore. Journal of Graphics Tools, 1997.〕 Among other uses, it can be used in computer graphics to implement ray tracing computations involving triangle meshes.〔(【引用サイトリンク】title=Möller-Trumbore algorithm )〕 ==Pseudocode== Assuming a Vec3 datatype and the SUB (element-wise subtraction), CROSS, and DOT operations, the following C program describes the algorithm: #define EPSILON 0.000001 int triangle_intersection( const Vec3 V1, // Triangle vertices const Vec3 V2, const Vec3 V3, const Vec3 O, //Ray origin const Vec3 D, //Ray direction float * out ) 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Möller–Trumbore intersection algorithm」の詳細全文を読む スポンサード リンク
|